<?php

namespace app\common\model;

use think\Model;

/**
 *友情链接model
 */
class Link extends Model
{

    /**
     * 后台友链分页列表
     * */
    public static function page_lists()
    {
        return self::where(['is_del' => 0])->order('sort asc,id asc')->paginate();

    }

    /**
     * 前台友链展示列表
     * */
    public static function get_links($limit = 10)
    {
        return self::where(['is_del' => 0, 'is_show' => 1])->field('link_name,link_img,link_url')->limit($limit)->order('sort asc,id asc')->select();
    }

}
